package com.example.demo.mapper;

import com.example.demo.mode.Klass;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface KlassMapper {
//    @Select("select id, name, major from klass")
    List<Klass> findAll();
    @Delete("delete from klass where id=#{id}")
    void deleteById(String id);
    @Insert("insert into klass(id,name,major) values(#{id},#{name},#{major})")
    void save(Klass s);

    @Update("update klass set name = #{name}, major = #{major} where id = #{id}")
    void update(Klass s);

    @Select("select * from klass where id=#{id}")
    public Klass getReferenceById(String id);
}
